<%@ Page Language="C#" ValidateRequest="false" %>

<%@ Register TagPrefix="bloget" Namespace="BlueOnionSoftware.Bloget" Assembly="Bloget" %>

<script runat="server">
    //protected override void OnLoad(EventArgs e)
    //{
    //    try
    //    {
    //        if (!string.IsNullOrEmpty(bloget.QueryPost()))
    //        {
    //            Post post = bloget.GetPost(new Guid(bloget.QueryPost));
    //            Page.Title = post.Title + " | Blue Onion Software *";
    //        }
    //    }
    //    catch
    //    {
    //    }
    //}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title runat="server">
        <%= (blog != null) ? blog.BlogTitle : "" %>
    </title>
    <style type="text/css">
        a:link { color: #226B6E; text-decoration: none; }
        a:visited { color: #3C787A; text-decoration: none; }
        a:active { color: #996C01; text-decoration: none; }
        a:hover { color: gray; text-decoration: underline; }
        body { background-color: #7D7D7D; color: #595959; font-family: tahoma, sans-serif; font-size: 10pt; margin: 0 auto 1pc; }
        ul { margin-left: 1pc; padding-left: 0; }
        li { list-style-type: disc; }
        blockquote { font-size: 88%; line-height: 1.25em; color: #000; margin: 0; padding: 10px 20px; }
        h1, h2, h3, h4, h5, h6 { font-size: 11pt; font-weight: 700; }
        img { border-style: none; }
        pre, code, samp, kbd, tt { font-family: "Courier New" , monospace; font-size: 90%; font-style: normal; line-height: normal; }
        address, cite { text-align: right; }
        hr { color: #046598; background-color: #046598; border: 0; height: 1px; }
        #main, #footer { width: 860px; clear: both; margin: 20px auto; }
        #blog-header { width: 860px; height: 100px; background-color: #505050; margin-bottom: 15px; border-top: 1px solid silver; }
        #blog-header h1 { font-size: 18pt; font-weight: 700; color: #E0E0E0; margin: 0; padding: 25px 20px 0; }
        #blog-header h1 a { text-decoration: none; color: #E0E0E0; }
        #blog-header h1 a:hover { text-decoration: none; color: silver; }
        #blog-header p { margin-top: 20px; border-top: 1px solid silver; color: #FFF; background-color: #598890; font-size: 10pt; padding: 5px 15px; }
        #main-content { float: left; width: 595px; margin: 0; }
        #content { max-width: 585px; color: #000; background: #fff; line-height: 1.25em; margin: 0; padding: 10px 20px 20px; }
        #sidebar-content { float: right; width: 250px; margin: 0; }
        #sidebar { max-width: 250px; background-color: #E5E5E5; color: #000; margin: 0; padding: 20px; }
        .sidebar-title { color: #6C6C6C; font-size: 11pt; font-variant: small-caps; }
        .sidebar-info-block { width: 210px; padding-bottom: 10px; border-bottom: 1px solid #598890; }
        .admin-menu ul { list-style-type: none; margin: 1pc auto; }
        .admin-menu li { display: inline; padding-right: 1.5em; }
        .admin-view fieldset { margin-bottom: 1em; }
        .admin-view legend { font-weight: 700; font-variant: small-caps; color: navy; }
        .post-related { font-style: italic; margin-bottom: 0; }
        .post-title { margin-bottom: 0; }
        .post-related + ul, .post-date { margin-top: .25em; }
        .comment-label, .admin-view-label, .password-view-label, .users-view-label, .edituser-view-label { float: left; min-width: 12em; }
        .admin-view-input, select, .users-view-input, .edituser-view-input, .password-view-input { margin-bottom: .5em; }
        .users-view-users { width: 100%; }
    </style>
</head>
<body>
    <form id="form" runat="server">
    <div id="main">
        <div id="blog-header">
            <bloget:BlogetTitle ID="blogTitle" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
        </div>
        <div id="main-content">
            <div id="content">
                <bloget:BlogetBlog ID="blog" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
            </div>
        </div>
        <div id="sidebar-content">
            <div id="sidebar">
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        About</h3>
                    <img src="~/blog.jpg" width="150" alt="" runat="server" />
                    <ul>
                        <li>Your Name </li>
                        <li>Your Location </li>
                        <li><a href="<%= (blog != null) ? blog.Page.Request.Path : "" %>?m=rss" type="text/xml">
                            RSS 2.0</a></li>
                    </ul>
                </div>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Search</h3>
                    <bloget:BlogetSearch ID="search" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
                    <br />
                    <br />
                </div>
                <% if (blog != null && blog.IsLoggedIn)
                   { %>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Admininstration</h3>
                    <ul>
                        <li><a href="?m=edit">Write New Post</a></li>
                        <li><a href="?m=admin">Administation</a></li>
                        <li><a href="?m=users">Users</a></li>
                        <li><a href="?m=drafts">Drafts</a></li>
                        <li><a href="?m=log">Event Log</a></li>
                        <li><a href="?m=logoff">Logout</a></li>
                    </ul>
                </div>
                <% } %>
<%--                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Categories</h3>
                    <bloget:BlogetCategory ID="categories" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
                </div>--%>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Previous</h3>
                    <bloget:BlogetRecentPosts ID="recentPosts" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
                </div>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Archives</h3>
                    <bloget:BlogetArchive ID="archives" runat="server" DataContext="~/App_Data/Blog/Blog.xml" />
                </div>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Links</h3>
                    <ul>
                        <li><a href="http://example.com">Your Link</a></li>
                        <li><a href="http://example.com">Your Link</a></li>
                        <li><a href="http://example.com">Your Link</a></li>
                    </ul>
                </div>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Blog Roll</h3>
                    <bloget:BlogetBlogRoll runat="server" ID="blogroll" DataContext="~/App_Data/Blog/Blog.xml"
                        Length="10" Random="true" Uri="http://blueonionsoftware.com/google-reader-subscriptions.xml" />
                </div>
                <div class="sidebar-info-block">
                    <h3 class="sidebar-title">
                        Meta</h3>
                    <%
                        Response.Write("<a href=\"?m=admin\">" + ((blog != null && blog.IsLoggedIn) ? "Admin</a>" : "Login</a>"));
                    %>
                </div>
            </div>
        </div>
    </div>
    <div id="footer">
        <p>
            footer here...</p>
    </div>
    </form>
</body>
</html>
